﻿<?xml version="1.0" encoding="utf-8"?>
<Application x:Class="MyMeetup.App" 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:vm="clr-namespace:MyMeetup.ViewModels"
             xmlns:Maps="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"
             xmlns:ig="clr-namespace:Infragistics.Controls.Interactions;assembly=InfragisticsWP7.Controls.Interactions.XamRating.v11.2"
             mc:Ignorable="d">
  <!--Application Resources-->
  <Application.Resources>
    <vm:GlobalViewModelLocator x:Key="Locator" />

        <ControlTemplate x:Key="PushpinControlTemplate2" TargetType="Maps:Pushpin">
            <Rectangle Fill="{StaticResource PhoneAccentBrush}" Width="80" Height="80">
                <Rectangle.OpacityMask>
                    <ImageBrush ImageSource="/Images/location.png" Stretch="Fill" />
                </Rectangle.OpacityMask>
            </Rectangle>
        </ControlTemplate>

        <ControlTemplate x:Key="CalendarIconTemplate" TargetType="Image">
            <Rectangle Fill="{StaticResource PhoneForegroundBrush}" Width="50" Height="50">
                <Rectangle.OpacityMask>
                    <ImageBrush ImageSource="/Images/location.png" Stretch="Fill"/>
                </Rectangle.OpacityMask>
            </Rectangle>
        </ControlTemplate>


        <SolidColorBrush x:Key="MetroThemeAccentColor" Color="Gold"/>
        <SolidColorBrush x:Key="RatingItemUnselectedStroke" Color="#FFA3A3A3"/>
        <SolidColorBrush x:Key="RatingItemUnselectedFill" Color="#FFE7E7E7"/>

        <ControlTemplate x:Key="RatingItemTemplate" TargetType="ig:RatingItem">
            <Grid x:Name="TouchTarget" Background="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="RatingItemStates">
                        <VisualState x:Name="Unselected" />
                        <VisualState x:Name="Selected">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedGrid" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="UnselectedGrid" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Collapsed" />
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <!--<Image x:Name="Image" Source="/InfragisticsWP7.Controls.Interactions.XamRating.v11.2;component/Images/star.png" Height="45" Width="45">-->
                <Grid x:Name="UnselectedGrid" Visibility="Visible" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Path Width="41" Height="40" Stretch="Fill" StrokeThickness="1" Stroke="{StaticResource PhoneDisabledBrush}" Fill="{StaticResource PhoneBackgroundBrush}"
                              Data="F1 M 320.059,242.389L 314.659,255.985L 300.059,256.919L 311.322,266.257L 307.699,280.431L 320.059,272.605L 332.42,280.431L 328.797,266.257L 340.059,256.919L 325.459,255.985L 320.059,242.389 Z " />
                </Grid>
                <Grid x:Name="SelectedGrid" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Path Width="41" Height="40" Stretch="Fill" Stroke="{StaticResource MetroThemeAccentColor}" Fill="{StaticResource MetroThemeAccentColor}"
                              Data="F1 M 276.939,242.389L 271.539,255.985L 256.939,256.919L 268.202,266.257L 264.578,280.431L 276.939,272.605L 289.3,280.431L 285.676,266.257L 296.939,256.919L 282.339,255.985L 276.939,242.389 Z " />
                </Grid>
            </Grid>
        </ControlTemplate>

        <ControlTemplate x:Key="RatingItemTemplateSmall" TargetType="ig:RatingItem">
            <Grid x:Name="TouchTarget" Background="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="RatingItemStates">
                        <VisualState x:Name="Unselected" />
                        <VisualState x:Name="Selected">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedGrid" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="UnselectedGrid" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Collapsed" />
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <!--<Image x:Name="Image" Source="/InfragisticsWP7.Controls.Interactions.XamRating.v11.2;component/Images/star.png" Height="45" Width="45">-->
                <Grid x:Name="UnselectedGrid" Visibility="Visible" HorizontalAlignment="Center" >
                    <Path Width="21" Height="20" Stretch="Fill" StrokeThickness="1" Stroke="{StaticResource PhoneDisabledBrush}" Fill="{StaticResource PhoneBackgroundBrush}"
                              Data="F1 M 320.059,242.389L 314.659,255.985L 300.059,256.919L 311.322,266.257L 307.699,280.431L 320.059,272.605L 332.42,280.431L 328.797,266.257L 340.059,256.919L 325.459,255.985L 320.059,242.389 Z " />
                </Grid>
                <Grid x:Name="SelectedGrid" Visibility="Collapsed" HorizontalAlignment="Center" >
                    <Path Width="21" Height="20" Stretch="Fill" Stroke="{StaticResource MetroThemeAccentColor}" Fill="{StaticResource MetroThemeAccentColor}"
                              Data="F1 M 276.939,242.389L 271.539,255.985L 256.939,256.919L 268.202,266.257L 264.578,280.431L 276.939,272.605L 289.3,280.431L 285.676,266.257L 296.939,256.919L 282.339,255.985L 276.939,242.389 Z " />
                </Grid>
            </Grid>
        </ControlTemplate>

        <Style x:Key="xamRatingStyle" TargetType="ig:XamRating">
            <Setter Property="RatingItemsTemplate" Value="{StaticResource RatingItemTemplate}" />
        </Style>

        <Style x:Key="xamRatingStyleSmall" TargetType="ig:XamRating">
            <Setter Property="RatingItemsTemplate" Value="{StaticResource RatingItemTemplateSmall}" />
        </Style>


        <Style x:Key="ImageButton" TargetType="Button">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}" />
        <Setter Property="Padding" Value="0,0,0,0" />
        <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Button">
            <Grid Background="Transparent">
                <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver" />
                    <VisualState x:Name="Pressed">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}" />
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}" />
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Border x:Name="ButtonBackground" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="5,5,5,5">
                <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                </Border>
            </Grid>
            </ControlTemplate>
        </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" Value="{StaticResource TransparentBrush}" />
        </Style>
      
        <Style x:Key="ListButtonsWithImages" TargetType="Button">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}" />
        <Setter Property="Padding" Value="5,5,5,5" />
        <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Button">
            <Grid Background="Transparent">
                <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver" />
                    <VisualState x:Name="Pressed">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}" />
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}" />
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Border x:Name="ButtonBackground" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="10,5,10,5">
                <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                </Border>
            </Grid>
            </ControlTemplate>
        </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" Value="{StaticResource TransparentBrush}" />
        </Style>

            <DataTemplate x:Key="OpaqueHeader">
                <Grid>
                    <ContentPresenter>
                        <TextBlock Text="{Binding}" Opacity="1" FontWeight="Bold" />
                    </ContentPresenter>
                </Grid>
            </DataTemplate>

        <!--<Style TargetType="Grid">
            <Setter Property="Background" Value="White"/>
        </Style>-->
        <!--<Style TargetType="TextBlock">
            <Setter Property="Foreground" Value="Black"/>
        </Style>-->
        <Style x:Key="SingleItemList" TargetType="ListBoxItem">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="Padding" Value="12,12,12,12"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}" />
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBoxItem">
                        <Border x:Name="LayoutRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="LayoutRoot">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentContainer"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectionStates">
                                    <VisualState x:Name="Unselected"/>
                                    <VisualState x:Name="Selected">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>



    </Application.Resources>
  <Application.ApplicationLifetimeObjects>
    <!--Required object that handles lifetime events for the application-->
    <shell:PhoneApplicationService Launching="Application_Launching" Closing="Application_Closing" Activated="Application_Activated" Deactivated="Application_Deactivated" />
  </Application.ApplicationLifetimeObjects>
</Application>